package com.xsnet.grpc;

import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;

public class client {

    public static void main(String[] args) {
        ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 50010)
                .usePlaintext()
                .build();
        HelloGrpc.HelloBlockingStub blockingStub = HelloGrpc.newBlockingStub(channel);
        Service.HelloRequest request = Service.HelloRequest.newBuilder().setName("Jamie").build();
        Service.HelloReply helloReply = blockingStub.sayHello(request);
        System.out.println("返回消息问：" + helloReply.getMessage());

    }

}
